package com.kefu.chat.vo;

import lombok.Data;

@Data
public class ChooseAdminSort implements Comparable<ChooseAdminSort> {

    private String uid;
    private long maxAccept;
    private long currentAccept;

    @Override
    public int compareTo(ChooseAdminSort o) {
        if (o.getMaxAccept() == 0) {
            return -1;
        }
        double score = this.getCurrentAccept() * 1.0 / this.getMaxAccept();
        double oScore = o.getCurrentAccept() * 1.0 / o.getMaxAccept();
        if (score > oScore)
            return 1;
        else if (score < oScore)
            return -1;
        else
            return 0;
    }


}
